<template>
    <el-container>
        <el-main>
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" >
                <h3>部门新增</h3>
                <el-form-item label="部门名称" prop="name" style="width: 317px">
                    <el-input v-model="ruleForm.name"></el-input>
                </el-form-item>
                <el-form-item label="上司" prop="region">
                    <el-select v-model="value" disabled placeholder="公司">
                        <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
                    <el-button @click="resetForm('ruleForm')">重置</el-button>
                </el-form-item>
            </el-form>
        </el-main>
    </el-container>
</template>

<script>
    export default {
        name: "Qxinzenbumen",
        data() {
            return {
                ruleForm: {
                    name: '',
                },
                value: '',
                rules: {
                    name: [
                        { required: true, message: '请输入部门名称', trigger: 'blur' },
                        { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                    ],
                }
            };
        },
    }
</script>

<style scoped>
    .el-main {
        background-color:#ffffff;
        color: #333;

    }
</style>